package com.luych.toolbox.docker.service.controller;

import com.luych.toolbox.common.feign.intf.docker.service.DockerNetworkFeign;
import com.luych.toolbox.common.feign.param.docker.service.DockerNetworkParam;
import com.luych.toolbox.common.feign.view.docker.service.DockerNetworkView;
import com.luych.toolbox.common.page.CommonPageResult;
import com.luych.toolbox.docker.service.service.DockerNetworkService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "网络")
@RestController
@RequestMapping("/network")
public class DockerNetworkController implements DockerNetworkFeign {

    private final DockerNetworkService dockerNetworkService;

    @Autowired
    public DockerNetworkController(DockerNetworkService dockerNetworkService) {
        this.dockerNetworkService = dockerNetworkService;
    }

    @Override
    public CommonPageResult<DockerNetworkView> page(long pageSize, long pageNumber, String sort, String order, String serverId, String keyword) {
        return dockerNetworkService.page(pageSize, pageNumber, sort, order, serverId, keyword);
    }

    @Override
    public DockerNetworkView create(String serverId, DockerNetworkParam model) {
        return dockerNetworkService.create(serverId, model);
    }

    @Override
    public void remove(String serverId, String id) {
        dockerNetworkService.remove(serverId, id);
    }

    @Override
    public DockerNetworkView get(String serverId, String id) {
        return dockerNetworkService.get(serverId, id);
    }
}
